#ifndef TRANCEVIDEO_H
#define TRANCEVIDEO_H
#include<QString>
#include<QDebug>
#include<QThread>
#include <QObject>
extern "C"
{
#include "libavcodec/avcodec.h"
#include "libavdevice/avdevice.h"
#include "libavfilter/avfilter.h"
#include "libavformat/avformat.h"
#include "libavutil/avutil.h"
#include "libpostproc/postprocess.h"
#include "libswresample/swresample.h"
#include "libswscale/swscale.h"
}
class TranceVideo: public QObject
{

    Q_OBJECT
public:
    explicit TranceVideo(QObject *parent = nullptr);
      ~TranceVideo() override;  // 显式重写析构函数
    void openH264File(QString filepath);
    void tranceToMp4(QString filepath);
    int getFrameCount() const;
    void setFrameCount(int value);



    int getTotalFrames() const;
    void setTotalFrames(int value);

    int getX() const;
    void setX(int value);

private:
    AVFormatContext*inFormatContext;
    AVFormatContext*outFormatContext;
    AVOutputFormat*outputFormat;

    AVPacket*pkt;
    int videolndex;
    int frameCount;
    int totalFrames=0;

    int x=0;




};

#endif // TRANCEVIDEO_H
